import React from'react';
import ChildComponent from '../../components/Chidren/index';

function ParentComponent() {
    const message = "Hello from Parent";
    const handleClick = () => {
        console.log("Button clicked in Parent");
    };

    return (
        <div>
            <h1>Parent Component</h1>
            {/* 父组件将 message 和 handleClick 作为 props 传递给子组件 */}
            <ChildComponent message={message} onButtonClick={handleClick} />
        </div>
    );
}

export default ParentComponent;